<template>
  <div style="background: #fff; padding: 24px;">
    <!-- 查询区域 -->
    <div class="table-page-search-wrapper">
      <a-form layout="inline">
        <a-row :gutter="24">
          <a-col :md="6" :sm="24">
            <a-form-item label="物品名称">
              <a-input placeholder="输入物品名称查询" v-model="queryParam.itemName"></a-input>
            </a-form-item>
          </a-col>
          <a-col :md="6" :sm="24">
            <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
              <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
              <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
            </span>
          </a-col>
        </a-row>
      </a-form>
    </div>
    <!-- 操作按钮区域-start -->
    <div class="table-operator" style="margin-bottom: 10px;">
      <a-button type="primary" icon="download" @click="handleExportXls('入库物品导出表')">导出</a-button>
    </div>
    <!-- 操作按钮区域-end -->
    <!-- table区域-begin -->
    <div>
      <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
        <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择
        <a style="font-weight: 600">{{ selectedRowKeys.length }}</a
        >项
        <a style="margin-left: 24px" @click="onClearSelected">清空</a>
        <span style="float:right;">
          <a @click="loadData()"><a-icon type="sync" />刷新</a>
        </span>
      </div>
      <a-table
        ref="table"
        size="middle"
        bordered
        rowKey="id"
        :columns="columns"
        :dataSource="dataSource"
        :pagination="ipagination"
        :loading="loading"
        :rowSelection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
        @change="handleTableChange"
      >
        <!-- <span slot="action" slot-scope="text, record">
          <a @click="handleOpenFixtureCard(record)">详情</a>
          <a-divider type="vertical" />
        </span> -->
      </a-table>
    </div>
    <!-- table区域-end -->
    <!-- 详情列表-start -->
    <!-- <a-descriptions bordered>
      <a-descriptions-item label="标题">
        {{ queryParam.oaTitle }}
      </a-descriptions-item>
      <a-descriptions-item label="OA治具申请流程RequestId">
        {{ queryParam.oaRequestId }}
      </a-descriptions-item>
      <a-descriptions-item label="申请人工号">
        {{ queryParam.oaReqUserNo }}
      </a-descriptions-item>
      <a-descriptions-item label="申请人姓名">
        {{ queryParam.oaReqUserName }}
      </a-descriptions-item>
      <a-descriptions-item label="申请人部门">
        {{ queryParam.reqDepartment }}
      </a-descriptions-item>
      <a-descriptions-item label="项目编号">
        {{ queryParam.projNo }}
      </a-descriptions-item>
      <a-descriptions-item label="项目名称">
        {{ queryParam.projName }}
      </a-descriptions-item>
      <a-descriptions-item label="产品类型">
        {{ queryParam.prodType }}
      </a-descriptions-item>
      <a-descriptions-item label="电源功率">
        {{ queryParam.acdcPower }}
      </a-descriptions-item>
      <a-descriptions-item label="应用方式">
        {{ queryParam.applicationType }}
      </a-descriptions-item>
      <a-descriptions-item label="需求数量"> {{ queryParam.requestNum }} 台 </a-descriptions-item>
      <a-descriptions-item label="制作数量"> {{ queryParam.actualNum }} 台 </a-descriptions-item>
      <a-descriptions-item label="申请原因">
        {{ queryParam.requestReason }}
      </a-descriptions-item>
      <a-descriptions-item label="需求日期">
        {{ queryParam.requestDate }}
      </a-descriptions-item>
      <a-descriptions-item label="工装物料编码申请流程REQ_ID">
        {{ queryParam.oaMcFlowReqId }}
      </a-descriptions-item>
    </a-descriptions> -->
    <!-- 详情列表-end -->
  </div>
</template>

<script>
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import { getAction } from '@api/manage'
export default {
  name: 'InStock',
  mixins: [JeecgListMixin],
  data() {
    return {
      // 表头
      columns: [
        {
          title: '序号',
          key: 'rowIndex',
          width: 50,
          align: 'center',
          customRender: function(t, r, index) {
            return parseInt(index) + 1
          }
        },
        {
          title: '物品名称',
          align: 'center',
          dataIndex: 'itemName'
        },
        {
          title: '物品分类',
          align: 'center',
          dataIndex: 'itemCategoryName'
        },
        {
          title: '工装编号',
          align: 'center',
          dataIndex: 'fixtureCode'
        },
        {
          title: '是否在库',
          align: 'center',
          dataIndex: 'lockStatus'
        },
        {
          title: '仓库编号',
          align: 'center',
          dataIndex: 'warehouseNo'
        },
        {
          title: '货架',
          align: 'left',
          dataIndex: 'shelfNo'
        },
        {
          title: '层数',
          align: 'left',
          dataIndex: 'layerNo'
        },
        {
          title: '格子数',
          align: 'left',
          dataIndex: 'gridNo'
        }
        // {
        //   title: '操作',
        //   dataIndex: 'action',
        //   align: 'center',
        //   scopedSlots: { customRender: 'action' }
        // }
      ],
      url: {
        list: '/inWarehouseCtrl/getInWarehouseItemList',
        exportXlsUrl: '/inWarehouseCtrl/exportXls'
      }
    }
  },
  methods: {
    handleOpenFixtureCard() {}
  }
}
</script>

<style lang="less" scoped></style>
